//
//  New_VersionIntroduceViewController.m
//  fxxiaoke
//
//  Created by 褚夫银 on 16/9/21.
//  Copyright © 2016年 jc. All rights reserved.
//

#import "New_VersionIntroduceViewController.h"

@interface New_VersionIntroduceViewController () <UIScrollViewDelegate>

@property (nonatomic, strong) UIScrollView * scrollView;

@end

@implementation New_VersionIntroduceViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self p_navi];
    
    [self p_setupView];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - navi
- (void )p_navi
{
    _btnLeft.hidden = YES;
    _lblLeft.hidden = YES;
    _btnRight.hidden = YES;
    _lblRight.hidden = YES;
    _topView.hidden = YES;
}

//显示tabbar
- (void )viewWillAppear:(BOOL)animated
{
    [(AppDelegate *)[[UIApplication sharedApplication] delegate] hiddenTabBar];
}

#pragma mark - 布局
- (void )p_setupView
{
    self.view.backgroundColor = [UIColor groupTableViewBackgroundColor];
    
    self.scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
    self.scrollView.backgroundColor = [UIColor groupTableViewBackgroundColor];
    self.scrollView.contentSize = CGSizeMake(SCREEN_WIDTH * 5, 0);
    self.scrollView.delegate = self;
    self.scrollView.pagingEnabled = YES;
    self.scrollView.showsHorizontalScrollIndicator = NO;
    [self.view addSubview:self.scrollView];
    
    for (int i = 0; i < 5; i ++)
    {
        UIImageView * image_count = [[UIImageView alloc] initWithFrame:CGRectMake(0 + SCREEN_WIDTH * i, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
        image_count.image = [UIImage imageNamed:@"Timg_pic.jpg"];
        [self.scrollView addSubview:image_count];
    }
}

#pragma mark - scrollView代理
- (void )scrollViewWillBeginDragging:(UIScrollView *)scrollView
{
    if(scrollView.contentOffset.x >= SCREEN_WIDTH * 4.0)
    {
        [self.navigationController popViewControllerAnimated:YES];
    }
}

























@end
